﻿using System.Collections.Generic;

namespace SW.DDD.Domain
{
    /// <summary>
    /// 实体抽象接口
    /// </summary>
    /// <typeparam name="TKey">实体键</typeparam>
    public interface IEntity<out TKey> : IEntity 
        where TKey : notnull
    {
        TKey Id { get; }
    }

    /// <summary>
    /// 实体抽象接口
    /// </summary>
    public interface IEntity
    {
        IReadOnlyCollection<IDomainEvent<IEntity>> Events { get;}

        IEnumerable<IDomainEvent<IEntity>> DequeenAllEvent();
    }
}
